package com.tudouji.project.permission.mapper;

import com.tudouji.project.organization.domain.Department;
import com.tudouji.project.permission.domain.FlowPermissionAssignDO;
import com.tudouji.project.permission.domain.Salespermission;
import com.tudouji.project.store.domain.Storeroom;
import com.tudouji.project.system.domain.SysDept;
import org.springframework.data.repository.query.Param;

import java.util.List;

/**
 * ����ϵͳȨ��Mapper接口
 *
 * @author tudouji
 * @date 2021-04-23
 */
public interface SalespermissionMapper
{
    /**
     * 查询����ϵͳȨ��
     *
     * @param guid ����ϵͳȨ��ID
     * @return ����ϵͳȨ��
     */
    public Salespermission selectSalespermissionById(String guid);

    /**
     * 查询����ϵͳȨ��列表
     *
     * @param salespermission ����ϵͳȨ��
     * @return ����ϵͳȨ��集合
     */
    public List<Salespermission> selectSalespermissionList(Salespermission salespermission);
    public Salespermission selectSalespermission(Salespermission salespermission);

    /**
     * 新增����ϵͳȨ��
     *
     * @param salespermission ����ϵͳȨ��
     * @return 结果
     */
    public int insertSalespermission(Salespermission salespermission);

    /**
     * 删除����ϵͳȨ��
     *
     * @param guid ����ϵͳȨ��ID
     * @return 结果
     */
    public int deleteSalespermissionById(String guid);

    /**
     * 修改����ϵͳȨ��
     *
     * @param salespermission ����ϵͳȨ��
     * @return 结果
     */
    public int updateSalespermission(Salespermission salespermission);

    /**
     * 批量删除����ϵͳȨ��
     *
     * @param guids 需要删除的数据ID
     * @return 结果
     */
    public int deleteSalespermissionByIds(String[] guids);
    public List<Salespermission> findSrDeps(Salespermission permission);

    public List<Salespermission> findPCPerms(Salespermission p);

    public List<Department> findPCPermDepartment(Salespermission salespermission);
    public List<Storeroom> findPCPermStoreroom(Salespermission salespermission);

    public List<Department> getDepsPermisByOrg(Salespermission per);


    public List<SysDept> getDepsByPermissionCode(FlowPermissionAssignDO per);

    List<Storeroom> getUserOfSrbyPermssion(Storeroom storeroom);

    List<Salespermission> selectUserPermissInFlowTemp(Salespermission salespermission);

    /**
     * 根据用户id查询用户权限
     */
    List<Salespermission> selectPermissionByUserid(String userguid, Integer permission,Long deptId,String srguid,String orgid);

}
